﻿using System.Windows;
using System.Windows.Controls;
using CannedHeater.ViewModel;

namespace CannedHeater.View
{
    /// <summary>
    /// View that displays data  as a graph
    /// </summary>
    public partial class GraphView : UserControl
    {
        public GraphView()
        {
            InitializeComponent();
        }

        private void ShowLessTemp_Click(object sender, RoutedEventArgs e)
        {
            GraphViewModel gvm = this.DataContext as GraphViewModel;
            if (gvm != null) gvm.ShowLessGraphData(GraphViewModel.GraphDataGroup.Temp);
        }

        private void ShowMoreTemp_Click(object sender, RoutedEventArgs e)
        {
            GraphViewModel gvm = this.DataContext as GraphViewModel;
            if (gvm != null) gvm.ShowMoreGraphData(GraphViewModel.GraphDataGroup.Temp);
        }

        private void ShowLessAirFlow_Click(object sender, RoutedEventArgs e)
        {
            GraphViewModel gvm = this.DataContext as GraphViewModel;
            if (gvm != null) gvm.ShowLessGraphData(GraphViewModel.GraphDataGroup.AirFlow);
        }

        private void ShowMoreAirFlow_Click(object sender, RoutedEventArgs e)
        {
            GraphViewModel gvm = this.DataContext as GraphViewModel;
            if (gvm != null) gvm.ShowMoreGraphData(GraphViewModel.GraphDataGroup.AirFlow);
        }
    }

}
